#pragma once

#include <QtWidgets/QMainWindow>
#include <QString>
#include <QTimer>

#include "qgbcore.h"
#include "input_mapper.h"

#include "ui_qgboy.h"
#include "speaker.h"
#include "network_settings.h"


class QGBoy : public QMainWindow
{
    Q_OBJECT

public:
    QGBoy(QWidget *parent = Q_NULLPTR);
    ~QGBoy() = default;

    void loadRom(const QString& filename);

public slots:
    void openFile();
    void updateScreen();
    void networkInterfaceReady(QObject* net);

private:
    void closeEvent(QCloseEvent* event) override;
    void keyPressEvent(QKeyEvent* event) override;
    void keyReleaseEvent(QKeyEvent* event) override;
    void initMenuActions();

private:
    Ui::QGBoyClass ui;

    QGBCore m_core;
    Speaker m_speaker;
    InputMapper m_input;
    NetworkSettings net_settings;
    QTimer game_timer;
};
